package com.onluy.frameworkcloud.data.bean;


import java.io.Serializable;

public class Pagination
  implements Serializable
{
  private static final long serialVersionUID = 1L;
  public static final int MAX_PAGE_SIZE = 2000;
  public static final int MAX_RECODE_SIZE = 2147483647;
  private boolean batch;
  private boolean range;
  private boolean needCount = true;
  private boolean onlyCount = false;
  private int start;
  private int size;
  private int count;
  private int currPage;

  public Pagination()
  {
    this.range = true;
  }

  public Pagination(boolean batch)
  {
    setBatch(batch);
  }

  public Pagination setBatch(boolean batch)
  {
    this.batch = batch;
    if (batch) this.range = true;
    return this;
  }

  public Pagination setRange(int start, int size)
  {
    this.range = true;
    this.start = start;
    this.size = size;
    return this;
  }

  public boolean isBatch()
  {
    return this.batch;
  }

  public boolean isRange()
  {
    return this.range;
  }

  public boolean isNeedCount()
  {
    return this.needCount;
  }

  public Pagination setNeedCount(boolean needCount)
  {
    this.needCount = needCount;
    return this;
  }

  public int getCount()
  {
    return this.count;
  }

  public Pagination setCount(int count)
  {
    this.count = count;
    return this;
  }

  public int getStart()
  {
    return this.start;
  }

  public int getSize()
  {
    return this.size;
  }

  public int getCurrPage()
  {
    return this.currPage;
  }

  public Pagination setCurrPage(int currPage)
  {
    this.currPage = currPage;
    return this;
  }

  public boolean isOnlyCount()
  {
    return this.onlyCount;
  }

  public Pagination setOnlyCount(boolean onlyCount)
  {
    this.onlyCount = onlyCount;
    return this;
  }
}